package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_order_goods", schema = "", catalog = "onedollar")
public class TOrderGoodsEntity {
    private int recId;
    private Integer orderId;
    private Integer goodsId;
    private Integer enUserId;
    private String goodsName;
    private Integer goodsNumber;
    private BigDecimal marketPrice;
    private BigDecimal goodsPrice;
    private String goodsAttr;
    private Integer isGift;
    private Integer priceId;

    @Id
    @GeneratedValue
    @Column(name = "rec_id", nullable = false, insertable = true, updatable = true)
    public int getRecId() {
        return recId;
    }

    public void setRecId(int recId) {
        this.recId = recId;
    }

    @Basic
    @Column(name = "order_id", nullable = true, insertable = true, updatable = true)
    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "goods_id", nullable = true, insertable = true, updatable = true)
    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    @Basic
    @Column(name = "en_user_id", nullable = true, insertable = true, updatable = true)
    public Integer getEnUserId() {
        return enUserId;
    }

    public void setEnUserId(Integer enUserId) {
        this.enUserId = enUserId;
    }

    @Basic
    @Column(name = "goods_name", nullable = true, insertable = true, updatable = true, length = 100)
    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    @Basic
    @Column(name = "goods_number", nullable = true, insertable = true, updatable = true)
    public Integer getGoodsNumber() {
        return goodsNumber;
    }

    public void setGoodsNumber(Integer goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    @Basic
    @Column(name = "market_price", nullable = true, insertable = true, updatable = true, precision = 2)
    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    @Basic
    @Column(name = "goods_price", nullable = true, insertable = true, updatable = true, precision = 2)
    public BigDecimal getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(BigDecimal goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    @Basic
    @Column(name = "goods_attr", nullable = true, insertable = true, updatable = true, length = 100)
    public String getGoodsAttr() {
        return goodsAttr;
    }

    public void setGoodsAttr(String goodsAttr) {
        this.goodsAttr = goodsAttr;
    }

    @Basic
    @Column(name = "is_gift", nullable = true, insertable = true, updatable = true)
    public Integer getIsGift() {
        return isGift;
    }

    public void setIsGift(Integer isGift) {
        this.isGift = isGift;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TOrderGoodsEntity entity = (TOrderGoodsEntity) o;

        if (recId != entity.recId) return false;
        if (orderId != null ? !orderId.equals(entity.orderId) : entity.orderId != null) return false;
        if (goodsId != null ? !goodsId.equals(entity.goodsId) : entity.goodsId != null) return false;
        if (enUserId != null ? !enUserId.equals(entity.enUserId) : entity.enUserId != null) return false;
        if (goodsName != null ? !goodsName.equals(entity.goodsName) : entity.goodsName != null) return false;
        if (goodsNumber != null ? !goodsNumber.equals(entity.goodsNumber) : entity.goodsNumber != null) return false;
        if (marketPrice != null ? !marketPrice.equals(entity.marketPrice) : entity.marketPrice != null) return false;
        if (goodsPrice != null ? !goodsPrice.equals(entity.goodsPrice) : entity.goodsPrice != null) return false;
        if (goodsAttr != null ? !goodsAttr.equals(entity.goodsAttr) : entity.goodsAttr != null) return false;
        if (isGift != null ? !isGift.equals(entity.isGift) : entity.isGift != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = recId;
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
        result = 31 * result + (goodsId != null ? goodsId.hashCode() : 0);
        result = 31 * result + (enUserId != null ? enUserId.hashCode() : 0);
        result = 31 * result + (goodsName != null ? goodsName.hashCode() : 0);
        result = 31 * result + (goodsNumber != null ? goodsNumber.hashCode() : 0);
        result = 31 * result + (marketPrice != null ? marketPrice.hashCode() : 0);
        result = 31 * result + (goodsPrice != null ? goodsPrice.hashCode() : 0);
        result = 31 * result + (goodsAttr != null ? goodsAttr.hashCode() : 0);
        result = 31 * result + (isGift != null ? isGift.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "price_id", nullable = true, insertable = true, updatable = true)
    public Integer getPriceId() {
        return priceId;
    }

    public void setPriceId(Integer priceId) {
        this.priceId = priceId;
    }
}
